#!/bin/bash

# 根目录
ROOT_PATH="/www";

# 应用目录
APP_PATH=${ROOT_PATH}"/app";

# 应用日志目录
APPLOG_PATH=${ROOT_PATH}"/applog";

# 下载地址
DOWNLOAD_URL="https://taimei-ftp.oss-cn-shenzhen.aliyuncs.com"

# resin版本
RESIN="resin"
RESIN_VERSION="${RESIN}-4.0.64.tar.gz";
RESIN_DOWNLOAD_URL="http://caucho.com/download/${RESIN_VERSION}"

# node下载地址
NODE_DOWNLOAD_URL="https://rpm.nodesource.com/setup_13.x"

# openresty下载地址
OPENRESTY_DOWNLOAD_URL="https://openresty.org/package/centos/openresty.repo"

# java/jdk判断语句
JAVA_EXISTING="echo $(whereis java) | grep '/bin/java'"
JAVA_VERSION="1.8.0_251"
JAVA_RPM_VERSION="jdk-8u251-linux-x64.rpm"
JAVA_DOWNLOAD_URL="${DOWNLOAD_URL}/java/${JAVA_RPM_VERSION}"

check_directory_is_exists() {
  if [ ! -d $APP_PATH ]; then
    exec_cmd "mkdir -p ${APP_PATH}"
    # exec_cmd "chattr -R -ia ${APP_PATH}"
  fi;

  if [ ! -d $APPLOG_PATH ]; then
    exec_cmd "mkdir -p ${APPLOG_PATH}"
    # exec_cmd "chattr -R -ia ${APPLOG_PATH}"
  fi;
}
